package com.cwj.we.module.fragment;

import com.cwj.we.base.BaseObserver;
import com.cwj.we.base.BasePresenter;
import com.cwj.we.bean.BiZhiBean;
import com.cwj.we.bean.WallpaperBiZhiBean;

/**
 * created by cwj on 2024-11-30
 * Description: 手机壁纸类型Prensenter
 */
public class VerticalPrensenter extends BasePresenter<VerticalView> {

    public VerticalPrensenter(VerticalView baseView) {
        super(baseView);
    }

    /**
     * 获取最新壁纸
     */
    public void getNewBizhi(String id, Integer limit, Integer skip, Integer type) {
        addDisposable(apiServer.getNewBizhi(id,limit, skip), new BaseObserver<BiZhiBean>() {
            @Override
            public void onSuccess(BiZhiBean bean) {
                baseView.getNewBizhiSuccess(bean, type);
            }

            @Override
            public void onError(String msg) {
                baseView.onError(msg);
            }
        });
    }

    /**
     * 获取热门壁纸
     */
    public void getHotBizhi(String id, Integer limit, Integer skip, Integer type) {
        addDisposable(apiServer.getHotBizhi(id,limit, skip), new BaseObserver<BiZhiBean>() {
            @Override
            public void onSuccess(BiZhiBean bean) {
                baseView.getNewBizhiSuccess(bean, type);
            }

            @Override
            public void onError(String msg) {
                baseView.onError(msg);
            }
        });
    }

    /**
     * 获取电脑壁纸
     */
    public void getWallpaperBizhi(String id, Integer limit, Integer skip, Integer type) {
        addDisposable(apiServer.getWallpaperBizhi(id,limit, skip), new BaseObserver<WallpaperBiZhiBean>() {
            @Override
            public void onSuccess(WallpaperBiZhiBean bean) {
                baseView.getWallpaperBizhiSuccess(bean, type);
            }

            @Override
            public void onError(String msg) {
                baseView.onError(msg);
            }
        });
    }
}
